package com.baizhi.action;

import com.baizhi.entity.Survey;
import com.baizhi.service.SurveyService;
import com.baizhi.service.impl.SurveyServiceImpl;

import java.util.List;

public class SurveyAction {
	private SurveyService ss=new SurveyServiceImpl();
	private Survey survey;
	private List<Survey> surveyList;
	public String add(){
		ss.insert(survey);
		return "toList";
	}
	public String selectMy(){
		//1为admin账号的id
		surveyList=ss.selectMySurvey(1);
		return "list";
	}
	public String design(){
		survey=ss.selectOne(survey.getId());
		return "design";
	}
	public SurveyService getSs() {
		return ss;
	}
	public void setSs(SurveyService ss) {
		this.ss = ss;
	}
	public List<Survey> getSurveyList() {
		return surveyList;
	}
	public void setSurveyList(List<Survey> surveyList) {
		this.surveyList = surveyList;
	}
	public Survey getSurvey() {
		return survey;
	}
	public void setSurvey(Survey survey) {
		this.survey = survey;
	}
}
